#if !USE_CONSOLE

#include "src/interface/lightTreeItem.h"

#include <QString>
#include <iostream>

LightTreeItem::LightTreeItem(QTreeWidgetItem *_parentItem, Light *_l) : TreeItem(_parentItem), light(_l){
    setExpanded(true);
    update();
}

LightTreeItem::~LightTreeItem(){
}

void LightTreeItem::update(){
    QString str = "";

    switch(light->getType()){
        case AMBIENT_LIGHT:{
            str.append(QString::fromUtf8("Ambiente "));
            break;
        }
        case POINT_LIGHT:{
            str.append(QString::fromUtf8("Pontual "));
            str.append(QString::number(light->getId()));
            break;
        }
        case AREA_LIGHT:{
            str.append(QString::fromUtf8("Área "));
            str.append(QString::number(light->getId()));
            break;
        }
    }

    setText(0, str);
}

Light *LightTreeItem::getLight(){
    return light;
}

void LightTreeItem::select(bool _b){
    light->select(_b);
}
#endif //!USE_CONSOLE
